package cn.ywang;

import cn.ywang.event.Event;

import java.lang.reflect.Method;

/**
 * @author BeatificWang
 * @date 2019/1/1 19:46
 */
public class MouseTest {
	public static void main(String[] args) {
		Observer observer = new Observer();
		try {
			Method advice = Observer.class.getDeclaredMethod("advice", new Class[]{Event.class});
			Mouse mouse = new Mouse();
			mouse.addListener(EnumType.ON_CLICK, observer, advice);
			mouse.click();
		} catch (NoSuchMethodException e) {
			e.printStackTrace();
		}
	}
}
